blur: Take the radius as a double parameter
authorBenjamin Otte <otte@redhat.com>
Wed, 19 Sep 2012 15:28:40 +0000 (17:28 +0200)
committerBenjamin Otte <otte@redhat.com>
Thu, 20 Sep 2012 00:45:41 +0000 (02:45 +0200)
It's only ever used like that

gtk/gtkcairoblur.c
gtk/gtkcairoblurprivate.h

index c85e2e2ee62b32b7e9d7def123c47c8a5c67d72d..fb08401d045970c811578c898ffec0e5ff6a47e7 100644 (file)
@@ -173,23 +173,19 @@ _expblur (guchar* pixels,
           gint    width,
           gint    height,
           gint    channels,
-          gint    radius,
+          double  radius,
           gint    aprec,
           gint    zprec)
 {
   gint alpha;
-  gint row = 0;
-  gint col = 0;
-
-  if (radius < 1)
-    return;
+  int row, col;
 
   /* Calculate the alpha such that 90% of 
    * the kernel is within the radius.
    * (Kernel extends to infinity) */
   alpha = (gint) ((1 << aprec) * (1.0f - expf (-2.3f / (radius + 1.f))));
 
-  for (; row < height; row++)
+  for (row = 0; row < height; row++)
     _blurrow (pixels,
               width,
               height,
@@ -199,7 +195,7 @@ _expblur (guchar* pixels,
               aprec,
               zprec);
 
-  for(; col < width; col++)
+  for(col = 0; col < width; col++)
     _blurcol (pixels,
               width,
               height,
@@ -217,11 +213,10 @@ _expblur (guchar* pixels,
  * @radius: the blur radius.
  *
  * Blurs the cairo image surface at the given radius.
- *
  */
 void
 _gtk_cairo_blur_surface (cairo_surface_t* surface,
-                         guint            radius)
+                         double           radius)
 {
   cairo_format_t format;
   guchar*        pixels;
index 0b93bb593947c49b4cc882ecdb067de88f2d8348..e048bac8cd5c707f0e3d47f7a87d38d6110c130c 100644 (file)
@@ -29,8 +29,8 @@
 
 G_BEGIN_DECLS
 
-void            _gtk_cairo_blur_surface (cairo_surface_tsurface,
-                                         guint            radius);
+void            _gtk_cairo_blur_surface (cairo_surface_t *surface,
+                                         double           radius);
 
 G_END_DECLS